﻿Imports Alquilaqi

Public Class InmuebleAgregar

    Public inmuebleForm As InmuebleMain
    Public agregardueñoi As AgregarDueñoInmueble
    Public agregarCentroi As AgregarCentroInmueble


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        OpenFileDialog1.ShowDialog()
        Foto1Box.Text = OpenFileDialog1.FileName


    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        OpenFileDialog2.ShowDialog()
        Foto2Box.Text = OpenFileDialog2.FileName
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        Dim negocio As New InmuebleNegocio
        Try
           
            negocio.insertarInmueble(Me.iddueñoM.Text, Me.idcentroM.Text, Me.FechaDTP.Text, Me.PrecioBox.Text, Me.DireccionBox.Text, Me.NumPisoBox.Text, Me.TipInmuebleCBox.Text, Me.Foto1Box.Text, Me.Foto2Box.Text, Me.EstadoCB.Text, Me.URLgoogle.Text, Me.ValoracionBox.Text)

            'End If

            'Me.categoriasForm.dgvCategorias.DataSource = ""

            Me.Close()
        Catch ex As Exception
            mensaje.Text = "Hubo un error al guardar"
        End Try
    End Sub



    Private Sub InmuebleAgregar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Consultar1bt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Consultar1bt.Click
        Dim form As New AgregarDueñoInmueble
        form.MdiParent = Me.MdiParent
        form.inmuebleAgregar = Me
        form.Show()
    End Sub

    Private Sub Consultar2bt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Consultar2bt.Click
        Dim form As New AgregarCentroInmueble
        form.MdiParent = Me.MdiParent
        form.inmuebleAgregar = Me
        form.Show()
    End Sub
End Class